package com.elric.mall.dto;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Objects;

/**
 * 代码生成参数类
 *
 * @author yubaoshan
 * @date 2020年12月16日20:41:21
 */
public class CodeGenerateParam {

    /**
     * 主键
     */
    @NotNull(message = "id不能为空，请检查id参数")
    private Long id;

    /**
     * 作者姓名
     */
    @NotBlank(message = "作者姓名不能为空，请检查authorName参数")
    private String authorName;

    /**
     * 类名
     */
    @NotBlank(message = "类名不能为空，请检查className参数")
    private String className;

    /**
     * 是否移除表前缀
     */
    @NotBlank(message = "是否移除表前缀不能为空，请检查tablePrefix参数")
    private String tablePrefix;

    /**
     * 生成方式
     */
    @NotBlank(message = "生成方式不能为空，请检查generateType参数")
    private String generateType;

    /**
     * 数据库表名
     */
    @NotBlank(message = "数据库表名不能为空，请检查tableName参数")
    private String tableName;

    /**
     * 代码包名
     */
    private String packageName;

    /**
     * 业务名（业务代码包名称）
     */
    @NotBlank(message = "业务名不能为空，请检查busName参数")
    private String busName;

    /**
     * 功能名（数据库表名称）
     */
    @NotBlank(message = "功能名不能为空，请检查tableComment参数")
    private String tableComment;

    /**
     * 所属应用
     */
    @NotBlank(message = "所属应用不能为空，请检查appCode参数")
    private String appCode;

    /**
     * 菜单上级
     */
    @NotBlank(message = "菜单上级不能为空，请检查menuPid参数")
    private String menuPid;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getTablePrefix() {
        return tablePrefix;
    }

    public void setTablePrefix(String tablePrefix) {
        this.tablePrefix = tablePrefix;
    }

    public String getGenerateType() {
        return generateType;
    }

    public void setGenerateType(String generateType) {
        this.generateType = generateType;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    public String getBusName() {
        return busName;
    }

    public void setBusName(String busName) {
        this.busName = busName;
    }

    public String getTableComment() {
        return tableComment;
    }

    public void setTableComment(String tableComment) {
        this.tableComment = tableComment;
    }

    public String getAppCode() {
        return appCode;
    }

    public void setAppCode(String appCode) {
        this.appCode = appCode;
    }

    public String getMenuPid() {
        return menuPid;
    }

    public void setMenuPid(String menuPid) {
        this.menuPid = menuPid;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        CodeGenerateParam that = (CodeGenerateParam) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(authorName, that.authorName) &&
                Objects.equals(className, that.className) &&
                Objects.equals(tablePrefix, that.tablePrefix) &&
                Objects.equals(generateType, that.generateType) &&
                Objects.equals(tableName, that.tableName) &&
                Objects.equals(packageName, that.packageName) &&
                Objects.equals(busName, that.busName) &&
                Objects.equals(tableComment, that.tableComment) &&
                Objects.equals(appCode, that.appCode) &&
                Objects.equals(menuPid, that.menuPid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, authorName, className, tablePrefix, generateType, tableName, packageName, busName, tableComment, appCode, menuPid);
    }
}
